<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>可调配合同查询</title>
	<link rel="stylesheet" href="css/reset.css">
	<link rel="stylesheet" href="css/product.css">
	<link rel="stylesheet" href="css/select.css">
	<style>
	</style>
</head>
<body style="background:#fff;">
	<div class="main-content">
		<div class="main-bg1">		
			<div class="product-content clearfix">
				<!-- 费用清单 -->
				<div class="product-child">
					<div class="product-child-content">					
						<form id = "seachContractInboundForm">
						<div class="content-form">
							<ul>
								<li><span class="text-name">项目名称：</span><input type="text"></li>
								<li>
									<button class="btn-style-two" id = "seachContractInboundClick" >搜索</button>	
									<i class="btn-operation maleft20">重置</i>
									
								<button class="btn-style-two" id = "save"  type="button">确认</button>	
								</li>
								
							</ul>
						</div>
						</form>
						<li>					
							</li>
						<div class="content-list">
							<div class="info-list">
								<table class="content-table-two" bindClick = "seachContractInboundClick" bindForm = "seachContractInboundForm" datatable = "true" cellspacing="0" cellpadding="0" dataAction = "/contractInbound/findContractAppoint">
							      <tbody style = "display:none;">
										<th title = "项目编码" name = "projectcode" type = "string"></th>
										<th title = "项目名称" name = "projectname" type = "string"></th>
										<th title = "部门名称" name = "departmentname" type = "string"></th>
										<th title = "可调配数" name = "deNd" type = "Integer"></th>
										<th title = "操作" name = "op" type = "string"></th>
									</tbody>
								</table>
								
							</div>
						</div>
					</div>	
				</div>
			</div>
		</div>	
	</div>
	<script src="js/jquery-3.2.1.min.js"></script>
	<script type="text/javascript" src="lib/layer/2.4/layer.js"></script>
	<script src="js/select.jquery.js"></script>
	<script type="text/javascript" src = "js/util.js"></script>
	<script type="text/javascript" src = "js/table.js"></script>
	<script>
		$('.multiselect').multiselect({setMaxOptionNum:4,selectedHtmlValue:''});
		$('#single').multiselect({multiple:false,selectedHtmlValue:'待审核',setWidth: 140+'px'});
        function getHeight(){
            var myiframeH=$(".main-content").height();
            var _parent=$(window.parent.document);
            _parent.find('body').css('height',(myiframeH+150)+'px');
            _parent.find('.main-position').css('height',(myiframeH+100)+'px');
        };
        $('.main-content').resize(function(){
            getHeight();
        });
        function tableCallBack(my){
        	my.find("thead").find("tr").prepend("<td><input type=\"checkbox\"></td>");
			var $tr = my.find("tbody").eq(1).find("tr");
			for(var i = 0 ; i < $tr.length ; i++){
				var html = "<td><input type=\"checkbox\"></td>";
				$($tr[i]).prepend(html);
			}
			my.find("thead").find("input[type='checkbox']").click(function(){
				var $this = $(this);
				my.find("tbody").find("input[type='checkbox']").prop("checked",$this.is(":checked"));
			});
			var data =  my.getAllData();
        	data.forEach(function(value,i){
        		var $tr = my.find('tbody').eq(1).children('tr').eq(i).find('td:last');
        		$tr.append('<i class="btn-operation" onclick="saveInfo('+i+')">确认</i>');     		        		
        	})
        }
        function saveInfo(i){
        	var data = [];
        	data.push($("table").getAllData()[i]);
        	parent.setData(data);
        	parent.layer.closeAll();
        }
        $(document).ready(function(){
        	$('#save').click(function(){
        		var data = $('table').getCheckData();
        	 	parent.setData(data);
            	parent.layer.closeAll();
        	})
        })
	</script>
</body>
</html>